﻿@model IEnumerable<BabyShop.Site.Models.Product>

@if (Model != null) {
    int i = 1;
    <div class="list-h">
        @foreach (var product in Model) {
            string productDetailUrl = Url.Action("ProductDetail", "Product", new { keyGuid = product.ProductGuid });
            <dl>
            <dt class="p-img">
            <a target="_blank" href="@productDetailUrl">
            <img src="@(product.ProductPhoto)" alt="@product.ProductTitle" height="130" width="130">
            </a>
            <div class="p-price">￥@product.Price</div>
            </dt>
            <dd class="p-name">
            <a target="_blank" href="@productDetailUrl">@product.ProductName</a>
            </dd>
            </dl>
            if (i++ % 3 == 0) {
                @MvcHtmlString.Create("</div><div class='list-h'>")
            }
        }
    </div>
}
